- if @product and @nature and @started_at and @stopped_at
  :ruby
    data = {}.with_indifferent_access
    for analysis in Analysis.where(nature: @nature.name, product: @product).between(@started_at, @stopped_at).order(:sampled_at)
      at = analysis.sampled_at.to_usec
      for item in analysis.items
        data[item.indicator.name] ||= []
        data[item.indicator.name] << [at, item.value.to_s.to_f]
      end
    end
    series = []
    for item in @nature.items
      item = Nomen::Indicator[item]
      series << {type: item.curve, name: item.human_name, data: data[item.name]}
    end

  = spline_highcharts(series, y_axis: {title: {text: :indicator_value.tl} , opposite: true}, x_axis: {type: 'datetime'}, legend: true)
- elsif @nature and @started_at and @stopped_at
  :ruby
    data = {}.with_indifferent_access
    for analysis in Analysis.where(nature: @nature.name).between(@started_at, @stopped_at).order(:sampled_at)
      at = analysis.sampled_at.to_usec
      for item in analysis.items
        data[item.indicator.name] ||= []
        data[item.indicator.name] << [at, item.value.to_s.to_f]
      end
    end
    series = []
    for item in @nature.items
      item = Nomen::Indicator[item]
      series << {type: item.curve, name: item.human_name, data: data[item.name]}
    end

  = spline_highcharts(series, y_axis: {title: {text: :indicator_value.tl} , opposite: true}, x_axis: {type: 'datetime'}, legend: true)
- else
  = no_data
